using System;
using DotNetify;
using System.Threading;

namespace HelloWorld;

public class HelloWorld : BaseVM
{
    private Timer _timer;
    public string Greetings => "Hello World!";
    public DateTime ServerTime => DateTime.Now;

    public HelloWorld()
    {
        _timer = new Timer(state =>
        {
            Changed(nameof(ServerTime));
            PushUpdates();
        }, null, 0, 1000);
    }

    public override void Dispose() => _timer.Dispose();
}